#include<vector>
#include<map>
#include<string>
#include<set>
using std::vector;
using std::map;
using std::string;
using std::set;
using std::pair;
class Dictionary{
public:
    static Dictionary*getInstance();
    //根据文件路径初始化词典和索引表
    void init(const string&dictpath,const string&indexTablepath);
    //获取词典
    vector<pair<string,int>>& getDict();
    //获取索引表
    map<string,set<int>>& getIndexTable();
    Dictionary(const Dictionary&)=delete;
    Dictionary&operator =(const Dictionary&)=delete;
private:
    Dictionary();

    
private:
    static Dictionary*pDic;
    vector<pair<string,int>> _dict;
    map<string,set<int>> _indexTable;
};
